<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: younghxp
 * @Date: 2022-04-13 17:44:55
 * @LastEditors: younghxp
 * @LastEditTime: 2022-04-15 18:13:35
-->
<template>
  <div>
    <el-dialog
      custom-class="changePWDialog"
      width="500px"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :show-close="true"
      :modal-append-to-body="false"
      :append-to-body="true"
    >
      <div slot="title" class="header-title">
        <img src="../../assets/img/versionUpdate.png" alt="" />
        <div class="titleText">版本更新</div>
      </div>
      <div class="info">
        <h3>{{ updateInfo.title }}</h3>
        <!-- <p v-for="v in updateList" :key="v.id" class="detail">{{v.info}}</p> -->
        <div style="margin-top: 10px" v-html="updateInfo.content"></div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          class="commonBut saveBtn"
          @click="dialogVisible = false"
          >关闭</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'versionUpdateDialog',
  data() {
    return {
      dialogVisible: false,
      // updateList: []
      updateInfo: {},
    }
  },
  created() {
    this.isShowDialog()
  },
  methods: {
    isShowDialog() {
      this.axios.post('/api-i/distribution/getUserConfirm').then((res) => {
        if (!res.data.hasError) {
          if (res.data.result) {
            this.dialogVisible = true
            this.updateInfo = res.data.result
          } else {
            this.dialogVisible = false
          }
        } else {
          this.$message({
            type: 'error',
            message: res.data.errorMsg,
          })
        }
      })
    },
  },
  computed: {},
}
</script>

<style lang="less" scoped>
/deep/.el-dialog__header {
  height: 60px;
  padding: 0 !important;
  border: none;
  border-radius: 0;
  border-radius: 4px 4px 0 0;
}
/deep/.el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}
/deep/.el-dialog__footer {
  height: auto;
  text-align: center;
  border-radius: 0 0 4px 4px;
  background-color: #fff;
  padding: 20px 0;
}

/deep/.el-dialog__footer::after {
  height: 0 !important;
}

.header-title {
  position: relative;
  font-size: 0;
  img {
    width: 100%;
    height: 60px;
    margin-top: -1px;
  }
  .titleText {
    font-size: 24px;
    font-family: SourceHanSansCN-Bold, SourceHanSansCN;
    font-weight: bold;
    color: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
.info {
  padding: 24px 20px;
  padding-bottom: 0;
  h3 {
    font-size: 16px;
    font-family: SourceHanSansCN-Bold, SourceHanSansCN;
    font-weight: bold;
    color: #333333;
  }
  .detail {
    font-size: 14px;
    font-family: SourceHanSansCN-Regular, SourceHanSansCN;
    font-weight: 400;
    color: #666666;
    padding-left: 10px;
    margin-top: 12px;
    position: relative;
    &::before {
      content: '';
      width: 4px;
      height: 4px;
      background: #265faa;
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
    }
  }
}
</style>
